package com.xiaofan.controller;

import com.xiaofan.bean.BaseRespVo;
import com.xiaofan.bean.User;
import com.xiaofan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户登录
 *
 * @author 晓帆
 * @version 1.0
 **/
@RestController
@RequestMapping("user")
public class UserLoginController {
    @Autowired
    UserService userService;
    @RequestMapping("login")
    public BaseRespVo login(User user){
        Integer register = userService.registerByUser(user);
        if (register!=0){
            return BaseRespVo.ok();
        }
       return BaseRespVo.fail();
    }
}
